(defun
    Destroy ()
    (setq blc (calcBalance))
    (if (<= blc 0)
        (return-from Destroy 0)
    ) 
    (setq inCount (inputCount))
    (if (<= inCount 0)
        (return-from Destroy 0)        
    )
    (setq data (getCurUnitHashToSign))  
    (loop (setq i 0) (< i inCount) 
        (progn 
            (if (hasPrevOutParam i "addr")
                (progn       
                    (setq addr (getPrevOutParam i "addr"))          
                    (setq pk (getPKByAddr addr))
                    (setq sig (getSig pk))
                    (setq ret (verify pk data sig))
                    (if (not ret)
                        (return-from Destroy 0)
                    ) 
                ) 
            )
            (update i (+ i 1))
        )
    )
    (return-from Destroy 1)
)

(setq res (Destroy))


(print "Result of Contract[Destroy]: ")
(println res)